//
//  ViewController.m
//  NSExceptionTest
//
//  Created by rui on 13-9-8.
//  Copyright (c) 2013年 rui. All rights reserved.
//

#import "ViewController.h"
//#import "NSArray+ExceptionHandling.h"

@interface ViewController ()

@end

@implementation ViewController





- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
	
//	NSArray *array = @[@"123",@"345",@"123"];
//	@try {
//		[array objectAtIndex:5];
//	}
//	@catch (NSException *exception) {
//		NSLog(@"%@",[exception description]);
//	}
//	@finally {
//		NSException *e = [NSException exceptionWithName:@"123" reason:@"nill" userInfo:nil];
//		@throw e;
//	}
	
//	@try {
//		[NSException raise:@"123" format:@"1234"];
//	}
//	@catch (NSException *exception) {
//		NSLog(@"%@",[exception description]);
//	}
//	@finally {
//		
//	}
	
	
	
	[UIView beginAnimations:@"animation" context:NULL];
	[UIView setAnimationDuration:3.0];
	[UIView setAnimationDelegate:self];
	
	self.view.alpha = 0;
	
	[UIView commitAnimations];
	
	[self dosomething];
	
	
//	NSLog(@"alpha:%f",self.view.alpha);
//	self.view.alpha = 0.5;
}

- (void)dosomething{
	self.view.alpha = 0.8;
}

-(void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context
{
	NSLog(@"finished");
}


- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
